<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<tag:head title="缴费记录" ctx="${ctx}">
	<link href="${ctx}/assets/css/admin/admin_role_list/style.css" rel="stylesheet">	<!-- 该页面特定的样式 -->
</tag:head>

<tag:body>
	<!-- 左 上 导航 -->
	<tag:nav ctx="${ctx}"></tag:nav>

	<!-- page content -->
	<div class="right_col" role="main">
		<div class="">
			<div class="clearfix"></div>

			<div class="row">
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="x_panel">
						<div class="x_title">
							<h2>
								<c:choose>
									<c:when test="${requestScope.type == 0}">
										${requestScope.staff.name}的缴费记录
									</c:when>
									<c:when test="${requestScope.type == 1}">
										${requestScope.staff.name}的超期缴费记录
									</c:when>
									<c:when test="${requestScope.type == 2}">
										${requestScope.staff.name}的丢失缴费记录
									</c:when>
								</c:choose>
							</h2>
							<div class="clearfix"></div>
						</div>
						<div class="x_content">
							<table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
								<thead>
								<tr>
									<th width="5%"><input type="checkbox" id="check-all"></th>
									<th width="7%" style="display: none;">ID</th>
									<th width="10%">员工号</th>
									<th width="10%">员工名称</th>
									<th width="10%">图书号</th>
									<th width="10%">图书名称</th>
									<th width="10%">图书类别</th>
									<th width="10%">罚款金额</th>
									<th width="10%">罚款原因</th>
									<th width="15%">处理日期</th>
									<th width="10%">处理人</th>
								</tr>
								</thead>

								<tbody>
								<c:forEach var="payment" items="${requestScope.payments}">
									<tr>
										<td width="5%"><input type="checkbox"  name="table_records"/></td>
										<td width="7%" style="display: none;">${payment.paymentId}</td>
										<td width="10%">${payment.staff.staffId}</td>
										<td width="10%">${payment.staff.name}</td>
										<td width="10%">${payment.book.bookId}</td>
										<td width="10%">${payment.book.name}</td>
										<td width="10%">${payment.book.bookClass.name}</td>
										<td width="10%">${payment.money}</td>
										<td width="10%">
											<c:choose>
												<c:when test="${payment.reason == 1}"><span class="label label-danger">超期</span></c:when>
												<c:otherwise><span class="label label-warning">丢失</span></c:otherwise>
											</c:choose>
										</td>
										<td width="10%">${payment.date}</td>
										<td width="10%">${payment.admin.name}</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
                            <div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
                                <ul class="pagination">
                                    <li class="paginate_button previous disabled" id="datatable-checkbox_previous">
                                        <a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="0" tabindex="0">上一页</a>
                                    </li>
                                    <li class="paginate_button next disabled" id="datatable-checkbox_next">
                                        <a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="2" tabindex="0">下一页</a>
                                    </li>
                                </ul>
                            </div>
						</div>
					</div>
				</div>

			</div>


		</div>
	</div>
	<!-- /page content -->

	<!-- footer content -->
	<tag:footer></tag:footer>
</tag:body>
<!-- javascript -->
<tag:javascript ctx="${ctx}">
	<!-- this page -->
	<script src="${ctx}/assets/js/admin/admin_staff_payment_list/admin_staffPayment_list.js"></script>
	<script>
		<c:if test="${requestScope.error != null}">
		createPNotify("提示信息","error","${requestScope.error}");
		</c:if>
		var buttons = $("button.btn");
		<c:choose>
			<c:when test="${requestScope.type != null}">
				buttons.eq(${requestScope.type}).removeClass("btn-info");
				buttons.eq(${requestScope.type}).addClass("btn-primary");
			</c:when>
			<c:otherwise>
				buttons.eq(0).removeClass("btn-info");
				buttons.eq(0).addClass("btn-primary");
			</c:otherwise>
		</c:choose>

		initTable();

		<c:choose>
			<c:when test="${requestScope.page.pageSize == 10 || requestScope.page.pageSize == 50 || requestScope.page.pageSize == 25 || requestScope.page.pageSize == 100}">
				$("#pageSize").val(${requestScope.page.pageSize});
			</c:when>
			<c:otherwise>
			$("#pageSize").val("all");
			</c:otherwise>
		</c:choose>

        createPaging($('#datatable-checkbox_paginate'),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum},'searchPayments(this,' + "'${requestScope.username}'" + ",${requestScope.type})",10);
        adjustPagination($("#datatable-checkbox_paginate").children("ul"),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum});
	</script>
</tag:javascript>
</html>

<!-- start:确认操作 -->
<div class="modal fade bs-example-modal-eb" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title">确认</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<h4 class="info">成功或失败提示</h4>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:确认操作 -->

<!-- start:违规操作 -->
<div class="modal fade bs-example-modal-lb" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title">违规处理</h4>
			</div>
			<div class="modal-body postForm">
				<h4 class="red">违规原因:</h4>
				<h4>图书名:<span class="blue"></span></h4>
				<h4>处理费用(书的原价+额外费用):<span id="money" class="postParam red"></span></h4>
				<h4>处理人:<span></span></h4>
				<h4>日期:<span id="date" class="postParam"></span></h4>
				<h4 style="display: none;">超期天数:<span class="red"></span></h4>
				<h4 style="display: none;">借阅号:<span id="borrowId" class="postParam"></span></h4>
				<h4 style="display: none;">员工号:<span id="staffId" class="postParam"></span></h4>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<h4 class="info">成功或失败提示</h4>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:挂失操作 -->
